CREATE PROCEDURE RRHH_LLENAR_DESCRIPCIONES_L
@IDEMPLEADO INTEGER,
@TIPODOCID VARCHAR(50) OUTPUT,
@AREA VARCHAR(100) OUTPUT,
@CARGO VARCHAR(100) OUTPUT,
@ESTADO VARCHAR(50) OUTPUT,
@ESTADOTRAN INTEGER OUTPUT
AS

--SET TRANSACTION ISOLATION LEVEL SERIALIZABLE

BEGIN TRANSACTION

BEGIN TRY
	SET @TIPODOCID = (SELECT DESCRIPCION FROM TIPODOCUMENTO 
					  WHERE IDTIPODOC = 
					  (SELECT IDTIPODOC FROM EMPLEADO WHERE idEmpleado = @IDEMPLEADO))
	SET @AREA = (SELECT DESCRIPCION FROM AREA 
				 WHERE IDAREA =
				 (SELECT IDAREA FROM EMPLEADO WHERE idEmpleado = @IDEMPLEADO))
	SET @CARGO = (SELECT DESCRIPCION FROM CARGO
				  WHERE IDCARGO = 
				  (SELECT IDCARGO FROM EMPLEADO WHERE idEmpleado = @IDEMPLEADO) AND
				  IDAREA =
				  (SELECT idArea FROM EMPLEADO WHERE idEmpleado = @IDEMPLEADO))
	SET @ESTADO = (SELECT DESCRIPCION FROM ESTADOEMPLEADO
				   WHERE IDESTADO = 
				   (SELECT IDESTADO FROM EMPLEADO WHERE idEmpleado = @IDEMPLEADO))
	SET @ESTADOTRAN = 1
	COMMIT TRANSACTION
END TRY
BEGIN CATCH
	SET @ESTADOTRAN = 0
	ROLLBACK TRANSACTION
END CATCH
